package test;

import java.util.Scanner;

public class DiscountCalculator {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入消费金额：");
        double totalExpense = scanner.nextDouble();
        double actualExpense = totalExpense;
        if (totalExpense >= 300){
            System.out.print("请输入会员状态（1 表示会员，0 表示非会员）：");
            int isMember = scanner.nextInt();
            if (isMember == 1) {
                actualExpense = totalExpense * 0.8;
            } else {
                actualExpense = totalExpense * 0.9;
            }
            System.out.println("实际消费金额为：" + actualExpense);
        }else {
            System.out.println("实际消费金额为：" + actualExpense);
        }
    }
}